//
//  MainViewController.m
//  STBest
//
//  Created by apple on 2017/8/28.
//  Copyright © 2017年 apple. All rights reserved.
//

#import "MainViewController.h"
#import "STSportingManager.h"
#import "STSportingViewController.h"
#import "STSportingSpeaker.h"
@interface MainViewController ()

@end

@implementation MainViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
      [STSportingSpeaker sharedInstance].canSpeak = YES;
}

#pragma mark - action方法 -
- (IBAction)actionWalk:(id)sender {

    [self sportWithType:STSportingTrackingTypeWalk];
    
}
- (IBAction)actionRun:(id)sender {
    
    [self sportWithType:STSportingTrackingTypeRun];
    
}
- (IBAction)actionRide:(id)sender {
    
    [self sportWithType:STSportingTrackingTypeRide];
    
}

- (void)sportWithType:(STSportingTrackingType)type {
    [_SportingMgr startWithType:type];
    
    // 打开运动界面
    UIStoryboard *sb = [UIStoryboard storyboardWithName:@"Sporting" bundle:nil];
     STSportingViewController*vc = [sb instantiateViewControllerWithIdentifier:@"STSportingViewController"];
    [self presentViewController:vc animated:YES completion:nil];
    
}

@end
